<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">    <link rel="stylesheet" href="css/project/ui-res-v3.css">
    <link rel="stylesheet" href="css/project/ui-input-v3.css">
    <link rel="stylesheet" href="css/project/ui-color-v3.css">
	<link rel="stylesheet" href="css/ui-input_ac.css">
    <link rel="stylesheet" href="css/ui-img_ac.css">
    <link rel="stylesheet" href="css/ui-base_ac.css">
    <link rel="stylesheet" href="css/ui-box_ac.css">
    <link rel="stylesheet" href="css/ui-color_ac.css">
	<link rel="stylesheet" href="css/ensureNode.css">
	<link rel="stylesheet" href="css/project/style.css">
	
	<script src="js/zy_control.js"></script>
	<script src="js/zy_click.js"></script> 
	<script src="js/zy_json.js"></script>
	<script src="js/main.js"></script>
	<script src="js/accountsQuery.js"></script>
	<script src="js/talkingdata.js"></script>
	 <style>
            .bcImage {
                background-image: url(images/bcImage.png);
                background-size: 100% 100%;
            }
            .return {
                background-image: url('images/delaySchedule1.png');
                height: 1em;
                width: 1em;
            }
            .calendar {
                background-image: url('images/calendar.png');
                height: 1em;
                width: 1em;
            }
            .down {
                background-image: url('images/down-angle.png');
                width: 1em;
                height: 1em;
            }
            .yes {
                background-image: url(images/1_03.png);
                width: 1.3em;
                height: 1.3em;
            }
            .no {
                background-image: url(images/1_05.png);
                height: 1.3em;
                width: 1.3em;
            }
            .tx-col {
                color: #36395c;
            }
            .bc_wh {
                background-color: white;
            }
            .wid1 {
                width: 100%;
            }
            .hei1 {
                height: 100%;
            }
            .bor_t {
                border: 1px solid #669ab3;
            }
            .bor_s {
                /**border: 1px solid #4088ab;
                background-color: #0099ff;**/
				background-color: #DEDEDE;
                width: 1.6em;
                height: 1.5em;
            }
            .bor_b {
                border: 1px solid rgba(255,255,255);
                border-radius: .2em;
                padding: .75em;
                width: 5.5em;
            }
            .padd {
                padding: .1em;
            }
            .inp {
                width: 100%;
                height: 100%;
                border: 0px;
                font-size: 1em;
                padding: .15em;
            }
            .borr {
                border: 1px solid red;
            }
			
			/***new add****/
			.selecttxt1{
				margin-left: .2em;
				width: 1.5em;
				line-height: 2em;
			}
			.selecttxt2{
				margin-left: .2em;
				width: 13.5em;
				line-height: 2em;
			}
			/**控件统一宽度*/
			.setWidth{
				width: 28%;height:2em;
			}
			.textWidth{
				width: 23%;
				text-align:left;
				white-space: nowrap;
			}
        </style>
</head>
<body class="um-vp " ontouchstart>
        <div id="page_0" class="up ub ub-ver bc-bg" tabindex="0">
        	 <!--header开始-->
            <div id="header" class="uh ub t-wh" style="background-color: #36395c">
                <div class="nav-btn" id="nav-left" onclick="winClose('-1')">
                    <div class="return ub-img"></div>
                </div>
                <h1 class="ut ub-f1 ulev0 ut-s tx-c " tabindex="0" id="Title">外站应收应付查询</h1>
                <div class="nav-btn nav-bt" id="nav-right"></div>
            </div>
            <!--header结束-->
          <!--content开始-->
            <div id="content" class="ub-f1 tx-l uinn ub-img bcImage">
                <div class="" id="topcondition">
				<div class="ub-f1 ub-ver ub-ac ub-pc uinn" style="background-color: rgba(225,225,225,.2)">
		                    <div class="ub-ver ub-ac ub-pc ulev-1 tx-col">
		                        <div class="ub ub-hor ub-ac ub-pj wid1">
		                        	<div class="textWidth">航班日期：</div>
		                          <div class="ub ub-ac ub-pc ub-pj bc_wh bor_t setWidth">
		                          	<!--文本输入开始-->
									<div class="c-wh uba b-gra uinput uinn4">
									    <input placeholder="" id="flightTime" type="text" class="uc-a1 t-gra">
									</div>
									<!--文本输入结束-->
		                               <!-- <div id="dateTimes"  onload="displayCurentDate()">
		                                </div>
		                                <div class="ub-img calendar" onclick="datePicker()"></div>-->
		                            </div>
									<div class="textWidth">航线名称：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="hxName" class="ut-s tx-l t-gra ">
		                                    罗马-浦东
		                                </div>
		                              <!--<div class="ub ub-ac ub-pc bor_s">
		                                    <div class="down ub-img"></div>
		                                </div>-->
		                            </div>
		                        </div>
		                        </div>
		                </div>
						
						<div class="ub-ver ub-ac ub-pc ulev-1 tx-col">
		                        <div class="ub ub-hor ub-ac ub-pj wid1">
		                        	<div class="textWidth">机&nbsp;&nbsp;&nbsp; 号：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="jh" class="ut-s tx-l t-gra ">
		                                    FCO-PVG
		                                </div>
		                            <!--<div class="ub ub-ac ub-pc bor_s">
		                                    <div class="down ub-img"></div>
		                                </div>-->
		                            </div>
		                        </div>
									<div class="textWidth">机&nbsp;&nbsp;&nbsp; 型：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="jx" class="ut-s tx-l t-gra ">
		                                    788
		                                </div>
		                               <!--<div class="ub ub-ac ub-pc bor_s">
		                                    <div class="down ub-img"></div>
		                                </div>-->
		                            </div>
		                        </div>
		                        </div>
		                </div>
						
						<div class="ub-ver ub-ac ub-pc ulev-1 tx-col">
		                        <div class="ub ub-hor ub-ac ub-pj wid1">
		                        	<div class="textWidth">飞机所属：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="flightCompany" class="ut-s tx-l t-gra ">
		                                    上海公司
		                                </div>
		                                <!--<div class="ub ub-ac ub-pc bor_s">
		                                    <div class="down ub-img"></div>
		                                </div>-->
		                            </div>
		                        </div>
									<div class="textWidth">餐食公司：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="mealCompany" class="ut-s tx-l t-gra">
		                                    罗马餐食
		                                </div>
		                                <!--<div class="ub ub-ac ub-pc bor_s">
		                                    <div class="down ub-img"></div>
		                                </div>-->
		                            </div>
		                        </div>
		                        </div>
		                </div>
						
						<div class="ub-ver ub-ac ub-pc ulev-1 tx-col">
		                        <div class="ub ub-ac ub-pj uc-n sel wid1">
		                        <div class="textWidth">舱&nbsp;&nbsp;&nbsp; 位：</div>
		                         <!--下拉列表开始-->
									<div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
									    <div class="ub-f1 ub uba c-wh b-gra  sel">
									        <div class="ub-f1 ut-s uinn ulev-1 tx-l ulh-sel" id="cang" onchange="changgeDiv()">Y</div>
									        <div class="ubl b-gra c-06 umw2 ub ub-pc ub-ac">
									            <div class="down ub-img"></div>
									        </div>
									        <select name="sel0" selectedindex="0" id="sel0" onchange="changeDiv(this.id)">
									            <option value="F">Y</option>
												<option value="C">C</option>
												<option value="Y">F</option>
									        </select>
									    </div>
									</div>
									<div class="textWidth">舱位人数：</div>
		                           <div class="ub t-bla ub-ac ub-pj umar-t bc_wh bor_t setWidth">
		                            <div class="ub ub-ac ub-pj uc-n sel wid1">
		                                <div id="personNum" class="ut-s tx-l t-gra">0</div>
		                            </div>
		                        </div>
									<!--下拉列表结束-->
		                        </div>
		                </div>
					</div> 	
			</div>
			
			<!-- 按钮选项卡 --> 
			<div id="tabControl" class="tabControl"></div>	
			<!--详情表格固定表头-->
			<div id="tabletitle" class="uhide">
				<table class="tb">
						<tr>
							<th class="titleth ulev-3">计划餐种</th>
							<th class="titleth ulev-3">计划餐名</th>
							<th class="titleth ulev-3">实际餐种</th>
							<th class="titleth ulev-3">实际餐名</th>
							<th class="titleth ulev-3">计付</th>
							<th class="titleth ulev-3">实配</th>
							<th class="titleth ulev-3">实收</th>
						 </tr>
					</table>
			</div>
			<!--详情表格-->
			<div id="detailstable"  style="overflow:auto;" onscroll="loadNewDetail(this.clientHeight,this.scrollHeight,this.scrollTop)">
					<table  id="subdetails" class="tb">
					</table>
			</div>	
		
            <!--content结束-->
        </div>

    </body>
<script>
zy_init();

var page=1;
var PageSize=30;
var timeslot='';
var carrier='';
var fjgs='';
var csgs='';
var hb='';
var fjjh='';
var fjjx='';
var isPageEnd=false;
window.uexOnload=function(type)
{
	IC.talkingDataCount("外站应收应付费用","0024");
	if(!type){
		timeslot=getStorage("flightDate_detail");
		var arr=timeslot.split("-");
		var y=arr[0];
		var m=arr[1];
		m=m.length>2?m.substr(1,2):m;
		var d=arr[2];
		d=d.length>2?d.substr(1,2):d;
		timeslot=y+"-"+m+"-"+d;
		carrier=getStorage("carrier");
		fjgs=getStorage("aircraftCompanyId");
		csgs=getStorage("mealCompanyId");
		hb=getStorage("flightNo");
		fjjh=getStorage("fjjh");
		fjjx=getStorage("fjjx");
		
		$$("Title").innerHTML=carrier+"/"+hb;
		$$("flightTime").value=timeslot;
		$$("hxName").innerHTML=getStorage("hxName");
		$$("jx").innerHTML=fjjx;
		$$("jh").innerHTML=fjjh;
		$$("flightCompany").innerHTML=getStorage("aircraftCompanyName");
		$$("mealCompany").innerHTML=getStorage("mealCompanyName");
		
		dataPersonNum();
		
		 //画表格
		 var tabHtml=getTabControlHtmlDetail();
		$$("tabControl").innerHTML = tabHtml;
		$$("tabletitle").className='';
		dataLoading();
	}
}

var F_PEOPLE=0;//F舱人数
var C_PEOPLE=0;//C舱人数
var Y_PEOPLE=0;//Y舱人数
function dataPersonNum()
{
    var type='GetASAPDetialTitle';
	var idata =[{'key':'type','type':'0','value':type},{'key':'timeslot','type':'0','value':timeslot},{'key':'carrier','type':'0','value':carrier}, {'key':'fjgs','type':'0','value':fjgs}, {'key':'csgs','type':'0','value':csgs},{'key':'hb','type':'0','value':hb},{'key':'fjjx','type':'0','value':fjjx},{'key':'fjjh','type':'0','value':fjjh}];
//	alert("idata: "+JSON.stringify(idata))
	$.getJSON(Url, function(json){
			if(json!=null)
			{
				if(json.errorCode==0)
				{
//						console.log(type+" : "+JSON.stringify(json));
					
						F_PEOPLE=json.info[0].rows[0].F_PEOPLE;
						C_PEOPLE=json.info[0].rows[0].C_PEOPLE;
						Y_PEOPLE=json.info[0].rows[0].Y_PEOPLE;
						$$("personNum").innerHTML=Y_PEOPLE;  //默认Y舱
				}else
				{
//					$alert(json.errorMsg);   //错误提示
				}
			}
			
    }, "json",function(err){
 			alert(type+". err: "+err);
			}, "POST",idata,false);
}
function dataLoading()
{
	Loading(0);
    var type='GetASAPDetail';

	var idata =[{'key':'type','type':'0','value':type} , {'key':'page','type':'0','value':page} ,{'key':'PageSize','type':'0','value':PageSize},{'key':'timeslot','type':'0','value':timeslot},{'key':'carrier','type':'0','value':carrier}, {'key':'fjgs','type':'0','value':fjgs}, {'key':'csgs','type':'0','value':csgs},{'key':'hb','type':'0','value':hb},{'key':'fjjx','type':'0','value':fjjx},{'key':'fjjh','type':'0','value':fjjh}];
//		alert("idata: "+JSON.stringify(idata))
	$.getJSON(Url, function(json){
			if(json!=null)
			{
				Loading(-1);
				if(json.errorCode==0)
				{
//						console.log(type+" : "+JSON.stringify(json));
						dataClassify(json.info[0].rows);
						if(page==1)
						{
								var h=$$("header").offsetHeight;
								var h1=$$("topcondition").offsetHeight;
								var h2=$$("tabControl").offsetHeight;
								var h3=$$("tabletitle").offsetHeight;
								var bodyH = document.body.clientHeight;
								$$("detailstable").style.height=(bodyH-h1-h2-h3-h*2)+"px";
								tabCheckDetail(0);
						}else{
								 tabCheckDetail(parseInt(getStorage("number")));
						}
				}else
				{
					$alert(json.errorMsg);   //错误提示
					if(json.errorMsg=='no data!')
					{
						isPageEnd=true;
					}
				}
			}
			
    }, "json",function(err){
 			alert(type+". err: "+err);
			}, "POST",idata,false);
}


function changeDiv(id){
    var sl = document.getElementById(id);
    if (sl) {
        var sp = sl.parentElement; //<span>
        if (sp) {
            var ch = sp.getElementsByTagName("div")[0];
            var t = sl.options[sl.selectedIndex].text;
            if (ch) {
                ch.innerHTML = t;
//				dailyDetailHtml(t);
				cabin=t;
				changePersonNum(cabin);
				 tabCheckDetail(parseInt(getStorage("number")));
            }
        }
    }
}
function changePersonNum(cabin)
{
	IC.talkingDataCount("外站应收应付费用","0024");
	if(cabin=='C')
	{
		$$("personNum").innerHTML=C_PEOPLE;
	}else if(cabin=='Y')
	{
		$$("personNum").innerHTML=Y_PEOPLE;
	}else
	{
		$$("personNum").innerHTML=F_PEOPLE;
	}
}

/**
 * 
 * @param {Object} h 可见高度
 * @param {Object} sh  滚动条滚动高度
 * @param {Object} st  
 */
function loadNewDetail(h,sh,st)
{
	if(isPageEnd){
		return;
	}
	if(h+st>=sh-5)
	{
		page++;
		dataLoading();
	}
//	alert("h: "+h+" / "+sh+" / "+st);
}
</script>
</html>